//暴力求解
int maxArea(int* height, int heightSize) {
    //假设数组下标0~1存水最多
    int minLine = height[0] < height[1] ? height[0] : height[1];
    int returnMax = minLine * 1 ;

    int i = 0;
    int j = 0;
    for(i = 0;i < heightSize;i++)
    {
        for(j = 1 + i;j < heightSize;j++)
        {
        minLine = height[i] < height[j] ? height[i] : height[j];
        int mun = minLine * (j - i);
        if(mun > returnMax)
        {
            returnMax = mun;
        }
        }
    }
    return returnMax;
}

//双指针法
int maxArea(int* height, int heightSize) {
    //双指针法
    int left = 0;
    int right = heightSize - 1;
    int minLine = height[left] < height[right] ? height[left] : height[right];
    int returnMax = (right - left) * minLine;
    
    while(left < right)//让短的边移动
    {
        if(height[left] < height[right])
        {
            left++;
        }
        else
        {
            right--;
        }
        minLine = height[left] < height[right] ? height[left] : height[right];
        int max = (right - left) * minLine;
        if(max > returnMax)
        {
            returnMax = max;
        }
    }
    return returnMax;
}
